You are here: FAQ > Tips and Techniques > Searching from a Specific Place in an Extract File, Instead of Starting at the First Record

Searching from a Specific Place in an Extract File, Instead of Starting at the First Record

You can use a flag with the Move_It rule to begin a search from a prior occurrence in a file, instead of always starting at the beginning of the extract file. While this technique can reduce processing time, be careful when using it.

Note   This flag is only supported by the Move_It rule.

If you enter N in the mask field of a Move_It rule, the system begins its search at the last record processed by a Move_It rule. This flag speeds the processing of sequential and multiple Move_It rules in a single ddt file.

For example, suppose you have an extract file with over 1000 records and you know that near end of this list there are exactly 20 sequential records—not 19 or 21, but 20.

You can add a series of 20 sequential Move_It rules into your ddt file. The 1st occurrence in the list of 20 Move_It rules should not contain the N flag. All other occurrences (2 through 20) should have the N flag.

Note   Omit the N for the first record because that makes the system start looking from just about anywhere in the list, depending on your last Move_It.

You must put a one (1) in the Record field on each line of the DDT file for this technique to find the next record in the series. Remember to also enter 1 on the first record line; the line without N in the mask.

For very large extract files, as in this example, this technique eliminates a large number of function calls which get you to the next record in the list. You may have to move through many records to find the first record in the list, but every hit thereafter is going find a subsequent record in the list.